<template>
  <div>child</div>
  <el-text class="mx-1" type="primary" size="large">基座传来的值：{{ value }}</el-text>


  <h3>输入内容向基座传递参数：</h3>
  <el-input v-model="message" placeholder="请输入内容" style="width: 200px" @input="send"></el-input>
</template>

<script setup>

import { onMounted, ref } from 'vue'
import HelloWorld from './components/HelloWorld.vue'

const value = ref('')
const message = ref('')


onMounted(() => {
  window.microApp?.addDataListener((data) => {
    // console.log('来自主应用的数据', data)
    value.value = data.value
  })
})

const send = () => {
  // console.log(value.value, 'value.value----------------');
  window.microApp?.dispatch({ message: message.value })
}
</script>


<style scoped>
.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}

.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}

.logo.vue:hover {
  filter: drop-shadow(0 0 2em #42b883aa);
}
</style>
